extends TextureProgress

signal AIAttack
func _ready():
	connect("AIAttack",get_tree().current_scene.get_node("enemy"),"_attack")
	pass

func _on_enemy_hurt(v):
	value = value -v
	emit_signal("AIAttack")
	pass

func _process(delta):
	$life.text = str(value)
	if value <=0:
		get_tree().current_scene.get_node("win").show()
		pass
	pass
